package com.java.design.pattern.decorator;

import java.math.BigDecimal;

/**
 * 蛋糕的装饰器类，内部持有蛋糕Cake对象，这个就是扩展的关键
 *
 * @author xin.ding
 * @date 2020/10/29 18:12
 */
public class CakeDecorator extends Cake {
    private Cake cake;

    public CakeDecorator(Cake cake) {
        this.cake = cake;
    }

    @Override
    public String getCakeMsg() {
        return this.cake.getCakeMsg();
    }

    @Override
    public BigDecimal getPrice() {
        return this.cake.getPrice();
    }
}
